package regularizer;

/**
 * L2 Regularization term
 * @author tigerzhong
 *
 */
public class L2 implements Regularizer{
    
    @Override
    public double getValue(double w[]){
	double res = 0.0;
	for(int i=0;i<w.length;i++){
	    res += w[i]*w[i];
	}
	return Math.sqrt(res);
    }
    
    @Override
    public double getDev(double wi){
	return wi;
    }
    
}
